<template>
	<view>
		<uni-table>
			<uni-tr>
				<uni-th align="left">站点名称：{{ pointInfo.coorName }}</uni-th>
			</uni-tr>
			<uni-tr>
				<uni-th align="left">经度：{{ latitude }}</uni-th>
			</uni-tr>
			<uni-tr>
				<uni-th align="left">纬度：{{ longitude }}</uni-th>
			</uni-tr>
		</uni-table>
		<button @click="pointStatus_1" type="primary"> 点击上报 </button>
	</view>
</template>

<script>
	import { getUserProfile } from "@/api/system/user";
	import { pointStatus,pointDataSelect} from "@/api/repairs/repairs"
	export default {
		data() {
			return {
				pointInfo:{
					coorName:'',
				},
				latitude:'',
				longitude:'',
			}
		},
		mounted() {
			getUserProfile().then(res => {
				this.pointInfo.userId=res.data.userId
				pointDataSelect(this.pointInfo).then(res_n=>{
					this.pointInfo.coorName=res_n.data.coorName
					const coorD=res_n.data.coorDetail.split(',');
					this.latitude=coorD[0]
					this.longitude=coorD[1]
					console.log(coorD)
				})
			})
		},
		methods: {
			pointStatus_1() {
				pointStatus(this.pointInfo).then(res=>{
					this.$modal.showToast(res.msg)
				}) 
			}
		}
	}
</script>

<style>
	button{
		width: 100vw;
		position: absolute;
		bottom: 0vw;
	}
</style>